// components/product-card/product-card.js
Component({
  options: {
    styleIsolation: 'apply-shared'
  },
  /**
   * 组件的属性列表
   */
  properties: {
    prod: {
      type: Object,
      value: {
        id: 123,
        name: "aaa",
        credits: 8000,
        price: 39,
        cover: "/images/Test/avatar.jpg",
        stock: 1244
      }
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    toDetail: function() {
      wx.navigateTo({
        url: `/pkg/pages/prodDetail/prodDetail?itemId=${this.data.prod.id}`
      })
    }
  }
})